﻿using mozhi.smarterp.Business.Interfaces;
using Mozhi.Abp.Domain.AuthorCenter;
using System;
using Volo.Abp.Domain.Entities.Auditing;
using Volo.Abp.MultiTenancy;

namespace mozhi.smarterp.Business
{
    public class AggregateRootBase : AuditedAggregateRoot<Guid>, IMultiTenant, IDepartmentAudited, IApproveAudited
    {
        public virtual Guid? TenantId { get; protected set; }

        public virtual Guid? DepartmentId { get; protected set; }

        public virtual Department Department { get; protected set; }

        public virtual Guid? ApprovedBy { get; protected set; }

        public virtual DateTime? ApprovedDate { get; protected set; }

        protected AggregateRootBase() { }

        public AggregateRootBase(Guid id, Department department)
        {
            Id = id;
            DepartmentId = department == null ? default : department.Id;
            Department = department;
        }
    }
}
